package util;

import view.QueryView;

import java.time.LocalDate;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by gable on 2018/5/23.
 */
public class BaseUtil {

    /**
     * @Author: 杨青桦
     * @Description:  获取参数Map
     * @Date: 2018/5/23 13:55
     * @param queryView
     * @return
     */
    public static Map getParamMap(QueryView queryView){
        Map<String,Object> map = new HashMap<>();
        if(queryView.getYear() == null){
            map.put("year", LocalDate.now().getYear());
        }else{
            map.put("year",queryView.getYear());
        }
        map.put("hospitalId",queryView.getHospitalId());
        map.put("typeId",queryView.getTypeId());
        map.put("lastYear",(Integer)map.get("year")-1);
        map.put("month",queryView.getMonth());
        return map;
    }
}
